package com.yy.hi.okhttp2;

/**
 * User: gongyongfeng2@yy.com
 * Date: 2020/9/21 19 :52
 */
public class RealCall implements Call {
    private final Request originalRequest;
    private final OkHttpClient mOkHttpClient;

    public RealCall(Request request, OkHttpClient okHttpClient) {
        originalRequest = request;
        mOkHttpClient = okHttpClient;
    }

    public static RealCall newCall(Request request, OkHttpClient okHttpClient) {
        return new RealCall(request, okHttpClient);
    }

    @Override
    public void enqueue(Callback callback) {
        AsyncCall asyncCall = new AsyncCall(callback);
        mOkHttpClient.mDispatch.enqueue(asyncCall);
    }

    @Override
    public Response execute() {
        return null;
    }

    final class AsyncCall extends NamedRunnable {
        Callback callback;

        public AsyncCall(Callback callback) {
            this.callback = callback;
        }

        @Override
        protected void execute() {

        }
    }
}
